
import java.util.InputMismatchException;
import java.util.Scanner;


public class Haha {
    public static int input(Scanner sc) {
        while (true) {
            try {
                System.out.print("请输入一个数：");
                return sc.nextInt();
            } catch (InputMismatchException ex) {
                sc.next();
            }
        }
    }
    public  static double chufa (int a , int b){
        try {
            return (double) (a/b);
        } catch (ArithmeticException e) {
            System.out.println("请重新输入，除数不能为0");
            return 111111111;
        }

    }

    public static void main77(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = input(sc);
        int b = input(sc);
        double ret = chufa(a,b);
        System.out.println(ret);

    }




    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.nextLine();
        int n = 0;
        int last = a.length() - 1;
        while( n < last){
            if (a.charAt(n) == a.charAt(last)) {
                n++;
                last--;
            } else {
                System.out.println("此数不是回文数");
                break;
            }
        }
        if( n == last) {
            System.out.println("此数是回文数");
        }

    }
    public static void main(String[] args) {
        int[] arr = new int[101];
        int people = 100;
        int num = 3;
        int count = 0;
        int k = 0;
        int i = 0;
        int [] arr2 = new int[100];
        int m = 0;
        while(count != people) {
            i++;
            if(i > people) {
                i = 1;
            }
            if(arr[i] == 0) {
                k++;
                if (k == num) {
                    arr2[m] = i;
                    k = 0;
                    count++;
                    m++;
                }

            }
        }
        System.out.println(arr2[arr2.length-1]);
    }
}




